package test3;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class FenetrePrincipale extends JFrame
{
	private static final long serialVersionUID = 1L;	
	private PannPrincipal jPanel2;
	private Panneau1 jPanel;
	private Panneau3 jPanel3;
	//private Image im;




	
	public FenetrePrincipale()
	{
		Toolkit tk = this.getToolkit();
		Dimension dim = tk.getScreenSize();
		setSize(dim);
		setTitle("Bienvenue sur QuickMessage");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setVisible(true);
	
	//	getImage("icon.jpg");
		String fichier = "icon.jpg";		
		BufferedImage im=null;
		try {
			im = ImageIO.read(new File(fichier));
		} catch (IOException e) {e.printStackTrace();}
		setIconImage(im);
	
		
		//setExtendedState(Frame.MAXIMIZED_BOTH);
		//setBounds(0, 0, 1000, 700);
		
		//setLayout(new GridLayout(3,1));

		//	setLayout(null);
		//setLayout(new BorderLayout());
		
		
	
		jPanel2=new PannPrincipal();
		//jPanel2.pp();
		jPanel2.setBackground(Color.GRAY);
		add(jPanel2,BorderLayout.CENTER);
		//add(jPanel2);
		
		
		Panneau3 jPanel3=new Panneau3();
		jPanel3.setBackground(Color.RED);
		add(jPanel3,BorderLayout.SOUTH);
		//add(jPanel3);
	/*	
		Panneau1 jPanel=new Panneau1();
		jPanel.setBackground(Color.YELLOW);
		add(jPanel,BorderLayout.NORTH);
		//add(jPanel);

*/

         
        
        
       
       
        



		
	//	setLayout(new BorderLayout());
	
		 
	//	add(jPanel, BorderLayout.NORTH); 
	//	add(jPanel2, BorderLayout.SOUTH); 

		
	/*	panneauPrin=new PannPrincipal();//paintcomponent
		panneauPrin.pc();//les boutons
		add(panneauPrin);*/	
		
		JMenuBar mb = new JMenuBar();setJMenuBar(mb);
		JMenu m1 = new JMenu("Fichier" );mb.add(m1);
		JMenu m2 = new JMenu("Contacts" );mb.add(m2);
		JMenu m3 = new JMenu("Options" );mb.add(m3);
		JMenu m4 = new JMenu("Aide" );mb.add(m4);
		JMenuItem mi11 = new JMenuItem("Se Déconnecter");m1.add(mi11);
		JMenuItem mi12 = new JMenuItem("Quitter");m1.add(mi12);
		JMenuItem mi21 = new JMenuItem("Ajouter un contact");m2.add(mi21);
		JMenuItem mi22 = new JMenuItem("Supprimer un contact");m2.add(mi22);
		JMenu mi31 = new JMenu("Choisir une couleur de fond");m3.add(mi31);
		JMenuItem mi31a = new JMenuItem("Bleu");mi31.add(mi31a);
		JMenuItem mi31b = new JMenuItem("Rose");mi31.add(mi31b);
		JMenuItem mi31c = new JMenuItem("Vert");mi31.add(mi31c);
		JMenuItem mi41 = new JMenuItem("???");m4.add(mi41);

	}
}
